package exception;

import be.kuleuven.cs.som.annotate.Basic;
import be.kuleuven.cs.som.annotate.Immutable;

/**
 * A runtime exception class. When a negative physical amount is been created, this Exception is thrown.
 * 
 * @author Molderez Tom, 2de bach Ingenieurswetenschappen Computerwetenschappen-Elektrotechniek and Reniers Jorn, 2de bach Ingenieurswetenschappen Werktuigkunde-Computerwetenschappen
 * @version 1.0
 *
 */
public class NegativeAmountException extends RuntimeException {
	
	private static final long serialVersionUID = 1L;

	/**
	 * Creates a negative amount exception.
	 * 
	 * @param value The negative value.
	 * @param message The message of this exception.
	 * 
	 * @effect
	 * 		| super(message)
	 * @post
	 * 		| this.getValue() == value
	 */
	public NegativeAmountException(Double value, String message) {
		super(message);
		this.value = value;
	}
	
	/**
	 * Returns the message with this overflow exception.
	 */
	@Override
	@Basic @Immutable
	public String getMessage() {
		return super.getMessage() + ", value: " + Double.toString(value);
	}
	
	@Basic @Immutable
	public Double getValue() {
		return value;
	}
	
	private final Double value;

	

}
